/*************************************************************************************
*                                  SRL ENGINE                                        *
*                                                                                    *
*                                                                                    *
*  File : SRL_LogOut.h                                                              *
*  Author: SRL Killing                                                               *
*  Date: 25/02/10 20:30                                                              *
*  Description:                                                                      *
*                                                                                    *  
*  Licence :  LGPL                                                                   *
*                                                                                    *
*    Copyright (C) 2010 Pecatte Baptiste                                             *
*                                                                                    *
*    This program is free software; you can redistribute it and/or                   *
*    modify it under the terms of the GNU Lesser General Public                      *
*    License as published by the Free Software Foundation; either                    *
*    version 2.1 of the License, or (at your option) any later version.              *
*                                                                                    *
*    This program is distributed in the hope that it will be useful,                 *
*    but WITHOUT ANY WARRANTY; without even the implied warranty of                  *
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU                *
*    Lesser General Public License for more details.                                 *
*                                                                                    *
*    You should have received a copy of the GNU Lesser General Public                *
*    License along with this program; if not, write to the Free Software             *
*    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    *
*                                                                                    *
**************************************************************************************/

#ifndef DefineHeaderLogout 
#define DefineHeaderLogout 

namespace srl {
    enum OutType {
        File,
        Console
    };
    
    class Log : public srl::Singleton<Log> {
        public:
        	Log();
            ~Log();
            //void Stream(std::ostream stream) { mStream = stream };
            
            static Log Info();
            static Log Warning();
            static Log Error();
            
            
        	
        	/******* Operators **********/
            //Clasic type writing functions
            Log& operator<< (std::string str);
            Log& operator<< (char* str);
            Log& operator<< (int i);
            Log& operator<< (float f);
            Log& operator<< (double d);
            
            // SRL type writing functions
            Log& operator<< ( srl::Vector<float> v);
            
            
        private:
        	//std::ostream mStream;
    };
    
    const std::string endl = "\n";
    
    class Exception {
    	public:
			Exception(char* desc, char* file, const char* func, int line) : mDesc(desc), mFile(file), mFunc(func), mLine(line) {} ;
			~Exception() {};
			
			std::string GetString();
			
			char* mDesc;
			char* mFile;
			const char* mFunc;
			int mLine;
    };
};

	#ifdef SRL_DebugMode
	
		#ifndef SRL_Except
			#define SRL_Except(desc) throw srl::Exception(desc, __FILE__, __PRETTY_FUNCTION__, __LINE__) 
		#endif
		
		/*#ifndef SRL_Error
		
		#endif*/
		
	#else
	
		#ifndef SRL_Except
			#define SRL_Except(desc) 
		#endif
	
	#endif
	
#endif 
